# Contributor: Matthieu Monnier <matthieu.monnier@enalean.com>
# Maintainer: Matthieu Monnier <matthieu.monnier@enalean.com>
pkgname=timew
pkgver=1.4.3
pkgrel=1
pkgdesc="Timewarrior is a command line time tracking application"
options="!check" # No testsuite
url="https://taskwarrior.org/"
arch="all"
license="MIT"
makedepends="cmake asciidoctor"
subpackages="$pkgname-doc $pkgname-bash-completion"
source="https://github.com/GothenburgBitFactory/timewarrior/releases/download/v$pkgver/timew-$pkgver.tar.gz
	fix-man-install.patch
	"
build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	install -Dm644 completion/timew-completion.bash \
		"$pkgdir"/usr/share/bash-completion/completions/timew
}

sha512sums="
89c98ad19d3a5ab5d4e02819d79e553cca4e93da99ec02bbf845b96b421cd084f6786de160e90c97854b50da49448472e9a4c7d23e75c8a93ecd67dda768b24a  timew-1.4.3.tar.gz
90715b4319599118c50fe388ef9d778698e4e3024a4c7fe1d5392d21fa96b96bde6472213abf0a22dd4b50b8f98eec550ba201a79fbdf1e5c5c1170756d812c8  fix-man-install.patch
"
